﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Reflection;
using System.Linq;
using System.Text;
using System.IO;
using System.Windows.Forms;
using DemoInterface;
using System.Configuration;

namespace WinFormForMEFDemo
{
    public class OperIoc
    {
        public CompositionContainer container;

        [ImportMany]
        public IForm[] Iformfrm { get; set; }
        public void Init()
        {
            var catalog = new DirectoryCatalog("Plugs", ConfigurationManager.AppSettings["CurrentModel"].ToString()); //指定目前扫描所有dll
            container = new CompositionContainer(catalog);
            container.ComposeParts(this);
        }
    }
}
